/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.asseco.mio;
import com.asseco.mio.codex.AssMark;
import com.asseco.mio.codex.MeasuresTaken;
import com.asseco.mio.codex.ResponsibilityReason;
import com.asseco.mio.codex.ResponsibilityType;
import com.asseco.mio.codex.UnassessedReason;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import org.appfuse.model.BaseObject;
import org.hibernate.annotations.GenericGenerator;
/**
 *
 * @author gjoko.mitrovski
 */
@Entity
@Table(name = "ASSESSMENTS")
public class Assessments extends BaseObject{

    private String id;
    private BasicInfo employment;
    private WorkPosition workPosition;
    private String assHalf;
    private Integer assYear;
    private Boolean isAssessed;
    private Double assessment;
    private AssMark assmark;
    private UnassessedReason unassReason;
    private Boolean status;
    private Date activeDate;
    private Date passiveDate;

    @Column(name = "ACTIVE_DATE")
    @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
    public Date getActiveDate() {
        return activeDate;
    }

    public void setActiveDate(Date activeDate) {
        this.activeDate = activeDate;
    }
   @Column(name = "ASSESS_HALF", length = 200)
    public String getAssHalf() {
        return assHalf;
    }

    public void setAssHalf(String assHalf) {
        this.assHalf = assHalf;
    }
   @Column(name = "ASSESS_YEAR", length = 200)
    public Integer getAssYear() {
        return assYear;
    }

    public void setAssYear(Integer assYear) {
        this.assYear = assYear;
    }
   @Column(name = "ASSESSMENT", length = 200)
    public Double getAssessment() {
        return assessment;
    }

    public void setAssessment(Double assessment) {
        this.assessment = assessment;
    }
    @ManyToOne
   @JoinColumn(name = "ASS_MARK_ID")
    public AssMark getAssmark() {
        return assmark;
    }

    public void setAssmark(AssMark assmark) {
        this.assmark = assmark;
    }
    @ManyToOne
   @JoinColumn(name = "EMP_ID")
    public BasicInfo getEmployment() {
        return employment;
    }

    public void setEmployment(BasicInfo employment) {
        this.employment = employment;
    }
@Id
    @GeneratedValue(generator = "system-uuid")
    @Column(length = 40)
@GenericGenerator(name = "system-uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
   @Column(name = "ISASSESSED", length = 200)
    public Boolean getIsAssessed() {
        return isAssessed;
    }

    public void setIsAssessed(Boolean isAssessed) {
        this.isAssessed = isAssessed;
    }
@Column(name = "PASSIVE_DATE")
    @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
    public Date getPassiveDate() {
        return passiveDate;
    }

    public void setPassiveDate(Date passiveDate) {
        this.passiveDate = passiveDate;
    }
   @Column(name = "STATUS", length = 200)
    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }
    @ManyToOne
   @JoinColumn(name = "UNASS_REASON_ID")
    public UnassessedReason getUnassReason() {
        return unassReason;
    }

    public void setUnassReason(UnassessedReason unassReason) {
        this.unassReason = unassReason;
    }
    @ManyToOne
   @JoinColumn(name = "POS_ID")
    public WorkPosition getWorkPosition() {
        return workPosition;
    }

    public void setWorkPosition(WorkPosition workPosition) {
        this.workPosition = workPosition;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Assessments other = (Assessments) obj;
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
            return false;
        }
        if (this.employment != other.employment && (this.employment == null || !this.employment.equals(other.employment))) {
            return false;
        }
        if (this.workPosition != other.workPosition && (this.workPosition == null || !this.workPosition.equals(other.workPosition))) {
            return false;
        }
        if ((this.assHalf == null) ? (other.assHalf != null) : !this.assHalf.equals(other.assHalf)) {
            return false;
        }
        if (this.assYear != other.assYear && (this.assYear == null || !this.assYear.equals(other.assYear))) {
            return false;
        }
        if (this.isAssessed != other.isAssessed && (this.isAssessed == null || !this.isAssessed.equals(other.isAssessed))) {
            return false;
        }
        if (this.assessment != other.assessment && (this.assessment == null || !this.assessment.equals(other.assessment))) {
            return false;
        }
        if (this.assmark != other.assmark && (this.assmark == null || !this.assmark.equals(other.assmark))) {
            return false;
        }
        if (this.unassReason != other.unassReason && (this.unassReason == null || !this.unassReason.equals(other.unassReason))) {
            return false;
        }
        if (this.status != other.status && (this.status == null || !this.status.equals(other.status))) {
            return false;
        }
        if (this.activeDate != other.activeDate && (this.activeDate == null || !this.activeDate.equals(other.activeDate))) {
            return false;
        }
        if (this.passiveDate != other.passiveDate && (this.passiveDate == null || !this.passiveDate.equals(other.passiveDate))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Assessments{" + " id= " + id + " employment= " + workPosition.getEmployment().getId() + " workPosition= " + workPosition.getId() + " assHalf= " + assHalf + " assYear= " + assYear + " isAssessed= " + isAssessed + " assessment= " + assessment + " assmark= " + assmark.getId() + " unassReason= " + unassReason.getId() + "status=" + status + " activeDate= " + activeDate + " passiveDate= " + passiveDate + '}';
    }

    

    @Override
    public int hashCode() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
